//
//  Public.h
//  WelfareManager
//
//  Created by timtian on 16/12/23.
//  Copyright © 2016年 timtian. All rights reserved.
//

#ifndef Public_h
#define Public_h
//全屏大小
#define __kSCREEN_SIZE ([[UIScreen mainScreen] bounds].size)
#define __kScreenHeight ([[UIScreen mainScreen]bounds].size.height)
#define __kScreenWidth ([[UIScreen mainScreen]bounds].size.width)

//滚动视图高度 210
#define __scrollHeight   (self.view.bounds.size.width*273)/485

//左边框距离
#define __kEdgeWtih  15

//上边距的距离
#define __kEdgeTop   37

//cell的高度
#define __kCellHeigh  55

#define kPATH_DOCUMENTS NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]

//以6的比例设置
#define __kRatio __kScreenHeight/667
#define __kwRatio __kScreenWidth/375

#define __kFixScaleToIP5 (__kSCREEN_SIZE.width/320)
#define __kFixHeightToIP5 (__kSCREEN_SIZE.height/568)

#define HGCOLOR(color) [UIColor colorWithHexString:color]



//判断尺寸大小

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define IS_PAD (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)

//适配机型


#define ADPT [[UIScreen mainScreen] bounds].size.width / (IS_IPHONE?750.0: 2048)
#define HGADPT(SIZE) SIZE*ADPT


#define SCREEN_MAX_LENGTH (MAX(__kScreenWidth, __kScreenHeight))
#define SCREEN_MIN_LENGTH (MIN(__kScreenWidth, __kScreenHeight))

#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

#define IOS7 [[[UIDevice currentDevice]systemVersion]doubleValue]>=7.0

#define IOS8 [[UIDevice currentDevice].systemVersion floatValue]>=8.0f

#define  kLESS_IOS9 [[UIDevice currentDevice].systemVersion floatValue]<9.0f

#define SEARCH_ORDER_SEARCH_HISTORY_CACHE_PATH [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"Searchhistories.plist"] // 订单搜索历史存储路径

//提示信息
#define SHOW_ALERT(meg) UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:meg delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];\
[alert show]

//弱引用/强引用
#define kWeakSelf(type)   __weak typeof(type) weak##type = type;
#define kStrongSelf(type) __strong typeof(type) type = weak##type;

//开发的时候打印，但是发布的时候不打印的NSLog
#ifdef DEBUG
#define NSLog(...) NSLog(@"%s 第%d行 \n %@\n\n",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
#else
#define NSLog(...)
#endif

//导入相关头文件
#import "UIViewExt.h"
#import "LMButton.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import <SDWebImage/UIButton+WebCache.h>
#import <MJRefresh/MJRefresh.h>
#import "AFNetworking.h"
#import "CommonTool.h"
#import "Masonry.h"
#import "MKAlertView.h"
#import "UserDefaultsHelper.h"
#import "UITextView+LineSpace.h"
#import "UILabel+Size.h"
#import <ReactiveObjC/ReactiveObjC.h>
#import "UIColor+BGHexColor.h"



#import "HTTPHelper.h"
#import "MJExtension.h"
#import "MBProgressHUD+HM.h"
#import "UIControl+LMRepeat.h"
#import "HGDataCheck.h"
#import "WHC_AutoLayout.h"
#import "LimitInput.h"
#import "LMCellView.h"
#import "UILabel+LXAdd.h"

#pragma mark - 网络请求


// 请求域名

#define  API_BASE_URL_STRING   @"http://127.0.0.1:8080/"
#define  API_EMP               [API_BASE_URL_STRING stringByAppendingString:@"emp/"]
#define  API_SERVICE           [API_BASE_URL_STRING stringByAppendingString:@"ser/"]
#define  API_CONSUME           [API_BASE_URL_STRING stringByAppendingString:@"consume/"]
#define  API_USER   [API_BASE_URL_STRING stringByAppendingString:@"user/"]
#define  API_COM   [API_BASE_URL_STRING stringByAppendingString:@"company/"]
#define  API_COMMON   [API_BASE_URL_STRING stringByAppendingString:@"common/"]
#define  API_E   [API_BASE_URL_STRING stringByAppendingString:@"e_scheme/"]
#define  API_Product   [API_BASE_URL_STRING stringByAppendingString:@"product/"]
#define  API_Template [API_E stringByAppendingString:@"template/"]
#define  API_Page [API_E stringByAppendingString:@"page/"]
#define  API_FeedBack [API_E stringByAppendingString:@"feedback/"]
#define  API_Order [API_BASE_URL_STRING stringByAppendingString:@"team_order/"]
#define  API_Finance   [API_BASE_URL_STRING stringByAppendingString:@"team_finance/"]
#define Access_Key @"LAPtXJMN1FImCLQa"
#define Access_Secter @"oT953JxnSHijGuRkhvFalAb7OVrdgz"
//登录测试账号13511111111 11111111


/***********************H5链接地址********************************/

/***********************H5链接地址********************************/
#endif /* Public_h */
